#!/bin/sh

# count.sh
# 
#
# Created by ［CGM］sgxiao on 08-12-15.
# Copyright 2008 CGM Inc. All rights reserved.

startYear=1994
endYear=2007
COUNT=sbo.right.data
DATA=sbo.data

filename=$1

function convert_to_right() {
	awk -f right.awk $1.${DATA} > $1.${COUNT}
}


while [ ${startYear} -le ${endYear} ]
do
	echo ${startYear}
	convert_to_right ${startYear}
	startYear=$((startYear + 1))		

done

mkdir ../${DATA}
mkdir ../${COUNT}

mv *.${COUNT} ../${COUNT}/
mv *.${DATA} ../${DATA}/